fs: expose FileHandle class and add isFileHandle method#61650
Open
amyssnippet wants to merge 4 commits intonodejs:mainfrom
Open
fs: expose FileHandle class and add isFileHandle method#61650amyssnippet wants to merge 4 commits intonodejs:mainfrom
amyssnippet wants to merge 4 commits intonodejs:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61650 +/- ##
==========================================
- Coverage 89.74% 89.73% -0.02%
==========================================
Files 674 674
Lines 204348 204381 +33
Branches 39271 39270 -1
==========================================
+ Hits 183396 183401 +5
- Misses 13262 13296 +34
+ Partials 7690 7684 -6
🚀 New features to boost your workflow:
|
Contributor
Author
|
the Ci failure on macos is because of a recent commit that increased the debugger timeout on macOS from 10s to 15s due to known timing issues. The error shows it's still timing out at 15s, suggesting the flakiness persists. Commit Details: amol@Amols-MBP node % git show 2bda7cbfb62
commit 2bda7cbfb62778bd793fbceaa9a5a907c3d344be
Author: Chengzhong Wu <legendecas@gmail.com>
Date: Fri Oct 24 10:21:32 2025 -0400
test: increase debugger waitFor timeout on macOS
PR-URL: https://github.com/nodejs/node/pull/60367
Refs: https://github.com/nodejs/node/actions/runs/18694915575/job/53309761263?pr=60343
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
diff --git a/test/common/debugger.js b/test/common/debugger.js
index 1a258913e00..f5a47cbe06e 100644
--- a/test/common/debugger.js
+++ b/test/common/debugger.js
@@ -7,12 +7,10 @@ const BREAK_MESSAGE = new RegExp('(?:' + [
'exception', 'other', 'promiseRejection', 'step',
].join('|') + ') in', 'i');
-// Some macOS machines require more time to receive the outputs from the client.
let TIMEOUT = common.platformTimeout(10000);
-if (common.isWindows) {
- // Some of the windows machines in the CI need more time to receive
- // the outputs from the client.
- // https://github.com/nodejs/build/issues/3014
+// Some macOS and Windows machines require more time to receive the outputs from the client.
+// https://github.com/nodejs/build/issues/3014
+if (common.isWindows || common.isMacOS) {
TIMEOUT = common.platformTimeout(15000);
} |
Contributor
|
> require('vm').runInNewContext('[]') instanceof Array
false |
Contributor
Author
i have seen there is a pattern in nodejs classes and i will update my function to follow it! thank you |
…y using private symbols instead of instanceof
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes the
FileHandleclass innode:fsandnode:fs/promises, allowing developers to reliably check if an object is a file handle usinginstanceofor the new static helper method. Previously,FileHandlewas hidden, forcing developers to rely on "duck typing" (checking for.fdand.closeproperties), which is unreliable.Changes:
FileHandleinlib/internal/fs/promises.js.FileHandleinlib/fs.js.FileHandle.isFileHandle(value)method.test/parallel/test-fs-filehandle-accessibility.js.Fixes: #61637